livecodefandomcom-20200223-history
MenuMode
Determines the appearance and behavior of menus associated with a button. combobox.png|Combo box pulldown.png|Pull down menumode cascade.png|Cascade menuMode popup.png|Popup menuMode tabbed.png|tabbed MenuMode optionMenu.png|Option MenuMode Syntax: set the menuMode of to Examples: set the menuMode of button "Edit" to pulldown Use the menuMode property to specify the appearance and behavior of the menu associated with a button. Any button's contents can be viewed as a menu if the button's style property is set to "menu". The menuMode setting creates menus of different types from the button's contents. (You set the button's contents with the text property.) You can also associate a stack with the button, using the menuName property. In this case, the contents of the stack's first card are displayed as a menu. * "pulldown": Displays each line of the button's contents as a menu item in a normal pulldown menu. Use this menuMode for buttons that are grouped into a menubar. Setting a button's menuMode to "pulldown" has the same result as creating the equivalent menu items (as buttons) in a stack, then using the pulldown command to display the stack as a menu. Note: On Mac OS and OS X systems, pulldown menus in a window are drawn by the standard operating system routines if the button's showBorder property is set to true and its borderWidth is not zero. Pulldown menus in the menu bar are always drawn by the operating system. * "cascade": Displays each line of the button's contents as a menu item in a hierarchical menu. (The button must be part of a stack menu.) * "popup": Displays each line of the button's contents as a menu item in a popup menu. The menu appears at the point of the mouse click. Setting a button's menuMode to "popup" has the same result as creating the equivalent menu items (as buttons) in a stack, then using the popup command to display the stack as a menu. * "tabbed": Displays the button's contents as a horizontal list of tabs, like the tabs on file folders. Each line of the button's contents is the title of a tab. Usually, tabbed buttons are used for dialog box or palettes containing a different group of controls for each tab. You can handle the menuPick message to display the correct group when a tab is clicked: on menuPick newTab,oldTab -- sent when user clicks a tab lock screen -- hide the swap hide group oldTab show group newTab unlock screen end menuPick * "comboBox": Displays the button's contents as a drop-down scrolling list, with an editable field at the top. Note: If a button's menuMode is set to "comboBox", the button receives field messages. For example, when the user clicks in the editable field, an openField message is sent to the button. * "option": Displays an option menu (when the lookAndFeel property is set to "Motif" ), a drop-down list (when the lookAndFeel property is set to "Windows 95" ), or a Mac-style popup menu (when the lookAndFeel property is set to "Appearance Manager" or "Macintosh" ). Setting a button's menuMode to option has the same result as creating the equivalent menu items (as buttons) in a stack, then using the option command to display the stack as a menu. Regardless of the menuMode, a menuPick message is sent to the button when the user chooses a menu item from the menu. The option style permit you to control selection with arrowkeys down and up and return/enter key. If the button's style property is not set to "menu", the setting of its menuMode property has no effect. See also: popup (command), menus (function), folders (function), openField (message), menuPick (message), stack (object), control (object), button (object), menuLines (property), showBorder (property), menuName (property), menubar (property), borderWidth (property), lookAndFeel (property), titleWidth (property), Category: menus Category:GUI